<%inherit file="/base/index.html"/>
<%namespace name="menu_nav" file="/components/menu.mako"/>

<script type="text/javascript">
    YAHOO.util.Event.onContentReady("usermenu", function () {
    var oMenu = new YAHOO.widget.Menu("usermenu",{
		position: "static",
		hidedelay: 750,
		lazyload: true});
    oMenu.render();
    oMenu.show();});
</script>
${next.body()}\
<%def name="top_nav()">
  ${menu_nav.top_nav(c.top_nav, c.top_nav_active)}
</%def>

<%def name="user_info()">

<% 
if session.has_key('user_client_dn'):
    dn =  session['user_client_dn'] 
    ca = session['user_client_ca'] 
elif session.has_key('user_slcs_obj'):
    slcs_obj = session['user_slcs_obj']
    dn = slcs_obj.get_dn() 
    ca = slcs_obj.get_ca() 
else:
    dn = 'Guest'
    ca = ''
%>


<script type="text/javascript"> 

    var tag = 'div#user-info';
    var _html = "<div id='ui_short'>${c.user_name} ${c.user_surname} </div>";

    _html += "<div id= 'ui_long'>${dn} <br /><br />(${ca}) </div>";
    
    $(tag).html(_html);
    
    $('#ui_short').css('display','inline');
    $('#ui_long').hide();
    
    $(tag).click(function() {
        $("#ui_long").toggle();
        $("#ui_short").toggle();
    });
</script>



</%def>

<%def name="menu()">
    ${menu_nav.menu(c.menu,c.menu_active,'usermenu')}
</%def> 

<%def name="css()">
  ${parent.css()}
    ${self.js_link("/js/jquery.min.js")}
</%def>

